<div class="success_sellers"></div>
<div class="row">

<div class="col-lg-4">
	<div class="col-lg-5">
     <div class="row">
     <a href="/shop/{echo $member['uid']}" target="_blank">{echo GetAvatarSimple($member['uid'],120,'img-rounded')}</a>
     </div>
      </div>
       
     <div class="col-lg-7">
    <div class="row">
    
     <p><b><a href="/shop/{echo $member['uid']}" target="_blank">{echo $member['username']}</a></b></p>
     {if $member['level']}<p><img src="/assets/img/level/level_{echo $member['level']}.png" title="等级值{echo $member['ability_level']}"/></p>{/if}
     <p>好评率：{echo $member['seller_haopinglu']/100}%</p>
     
     <p><i class="fa fa-map-marker"></i> {echo $member['provname']} {echo $member['cityname']} {echo $member['distname']}</p>
 	</div>
      </div>
      
      
      
      <div class="row">
     <div class="col-lg-12">
     		<strong>TA最新服务</strong>
           {php}$newdata=unserialize($member['newdata']);{/php}
              {if $newdata}
              <table class="table">
                  <tbody>
                  {foreach $newdata $data}
                    <tr>
                      <td><a href="/shop/fuwu/{echo $data['id']}" target="_blank"><span class="color_f60">￥{echo $data['money']}</span> {echo $data['subject']}</a></td>
                    </tr>
				  {/foreach}
                  </tbody>
                </table>
              {/if} 
     
     
     
     </div>
      </div>

</div>

<div class="col-lg-8">
<div class="well">

{if $uid==$order['buyer_uid'] && $task['process_order']==3 || IsService($task['serviceuid']) && $task['process_order']==3 || IsAdmin() && $task['process_order']==3}
	 <h2>服务商 {echo $order['seller_username']} 交接中</h2>
    <h5>等待服务商交接</h5>
    <p>订单自动关闭时间 <span class="text-danger">{echo FormatDate("Y-m-d H:i:s",$task['autopaytime'])}</span></p>

{elseif $uid==$order['seller_uid'] && $task['process_order']==3 || IsService($task['serviceuid']) && $task['process_order']==3 || IsAdmin() && $task['process_order']==3}
     <h2>{echo $order['seller_username']} 恭喜您中标了</h2>
     <p>请您确认交接</p>
     <p>订单自动关闭时间 <span class="text-danger">{echo FormatDate("Y-m-d H:i:s",$task['autopaytime'])}</span></p>
     <p>如果需要上传原件请使用上传文件进行上传。</p>
     <div class="row">
     <div class="col-lg-12">
   
         {template Public:Page:webuploader}
         <div class="col-lg-12"><div class="row">最多可添加五个附件，每个大小不超过{echo $uploadsize}M</div></div>
 
     </div>
     </div>
                
     <div class="text-right"><a id="UploadFile" href="javascript:void(0);">上传原件</a> <a class="btn btn-darkorange" href="javascript:void(0);" onclick="SubmitDelivery({echo $order['oid']});">确认交接</a></div>
     
{elseif $uid==$order['seller_uid'] && $task['process_order']==4 || IsService($task['serviceuid']) && $task['process_order']==4 || IsAdmin() && $task['process_order']==4}
    <h2>{echo $order['seller_username']} 恭喜您交接成功</h2>
    <h5>等待雇主确认</h5>
    <p>订单自动确认时间 <span class="text-danger">{echo FormatDate("Y-m-d H:i:s",$task['autopaytime'])}</span></p>
{elseif $uid==$order['buyer_uid'] && $task['process_order']==4  || IsService($task['serviceuid']) && $task['process_order']==4  || IsAdmin() && $task['process_order']==4}
     <h2>{echo $order['seller_username']} 已交接原件</h2>
     <p>请您确认付款</p>
     <p>订单自动确认时间 <span class="text-danger">{echo FormatDate("Y-m-d H:i:s",$task['autopaytime'])}</span></p>
     <p>下载原件 <span class="text-muted">(提示：鼠标右键下载名称,点另存为)</span></p>
     {if $orderfile}
     {foreach $orderfile $file}
     	<p><a href="/post/download/file/{echo $file['fid']}" target="_blank"><i class="glyphicon glyphicon-save"></i> {echo $file['filename']}</a></p>
     	<!-- <p><a href="/post/download/file/{echo $file['filepath']}" target="_blank"><i class="glyphicon glyphicon-save"></i> {echo $file['filename']}</a></p> -->
     {/foreach}
     {else}	
     <p>无原件</p>
     {/if}
     <div class="">
     	<!-- <a class="btn btn-warning btn-sm" href="javascript:void(0);" onclick="SubmitRefundOrder({echo $order['oid']});">驳回</a> -->
     	{template Public:Page:umeditor}
     	<textarea id="Content"  name="content"  style="height:200px;width:100%"></textarea>
     	<script type="text/javascript">
     		var um;
     		$(document).ready(function () {
			
				um = UM.getEditor('Content');

				um.addListener("contentChange",function(){
					if(UM.getEditor('Content').hasContents()){
						$('#RejectBtn').attr('disabled',false);
					}else{
						$('#RejectBtn').attr('disabled',true);
					}
				});
			})
     	</script>
     	<div class="col-pt-10 text-right">
     	<a class="btn btn-warning btn-sm" href="javascript:void(0);" id="RejectBtn" disabled="true" onclick="SubmitRejectOrder({echo $order['oid']});">驳回</a> <a class="btn btn-darkorange btn-sm" href="javascript:void(0);" onclick="SubmitPayOrder({echo $order['oid']});">确认并付款</a></div></div>
     
{elseif $uid==$order['seller_uid'] && $task['process_order']==5 && $order['seller_is_evaluate']==0 || IsService($task['serviceuid'])  && $task['process_order']==5 && $order['seller_is_evaluate']==0}
     {template Seller:Evaluate:form}
{elseif ($uid==$order['buyer_uid'] && $task['process_order']==5 && $order['buyer_is_evaluate']==0 || IsService($task['serviceuid']))  && $task['process_order']==5 && $order['buyer_is_evaluate']==0}
	{template Buyer:Evaluate:form}
{else}
     <h2>{echo $task['username']} 发布悬赏找到了满意的方案</h2>
     
     <h5>悬赏<strong>{echo $task['money']/100}</strong>元  共收到 <strong>{echo $task['draft_number']}</strong>个服务商报名参与</h5>
     <p>由{echo $order['seller_username']}完成需求！</p>
     <p>{echo C('sitename')}聚集了100万专业服务商，发布一个需求，收获众多创意 逛逛需求市场 </p>
     <div class="text-right"><a class="btn btn-darkorange btn-sm" href="/task/publish/index">我要发布需求</a></div>
{/if}

</div>
{if $rejectList}
<div class="well">
	<h2>驳回原因：</h2>
	{foreach $rejectList $reject}
		{echo FormatDate("Y-m-d H:i:s",$reject['time'])}:{echo $reject['content']}
	{/foreach}
</div>
{/if}
</div>

</div>

<script>
	
function SubmitDelivery(oid){
	
	var SecurityForm=$('#SecurityForm').val();
	
	bootbox.confirm({  
	   buttons: {  
		  confirm: {  
			 label: '确认',  
		  },  
		  cancel: {  
			 label: '取消',  
		  }  
	   },  
	   title:'提示',
	   message: '<i class="glyphicon glyphicon-warning-sign"></i> 您确认要操作'+oid+'号稿件交接?',  
		   callback: function(result) {  
			  if(result) {  
				 bootbox.hideAll();
				 
				 $.post('{echo U("/post/task/delivery/id/".$id)}',{oid:oid,SecurityForm:SecurityForm}, function(json) {
							
						$('.bootbox').PhpappProgress({json:json});

						return true;
							
				 }, 'json');
				 
				  bootbox.dialog({
						 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
						 title: '<i class="icon fa fa-retweet"></i> 提交中',
						 closeButton: false
				 }).PhpappProgress({time:5000});
			 
				  return false; 
	  
			  }
		   } 

	})
   
	return false;
		
}

function SubmitPayOrder(oid){
	
	var SecurityForm=$('#SecurityForm').val();
	
	bootbox.confirm({  
	   buttons: {  
		  confirm: {  
			 label: '确认',  
		  },  
		  cancel: {  
			 label: '取消',  
		  }  
	   },  
	   title:'提示',
	   message: '<i class="glyphicon glyphicon-warning-sign"></i> 您确认要付款'+oid+'号稿件操作?',  
		   callback: function(result) {  
			  if(result) {  
				 bootbox.hideAll();
				 
				 $.post('{echo U("/post/task/payorder/id/".$id)}',{oid:oid,SecurityForm:SecurityForm}, function(json) {
							
						$('.bootbox').PhpappProgress({json:json});

						return true;
							
				 }, 'json');
				 
				  bootbox.dialog({
						 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
						 title: '<i class="icon fa fa-retweet"></i> 提交中',
						 closeButton: false
				 }).PhpappProgress({time:5000});
			 
				  return false; 
	  
	  
			  }
		   } 

	})
   
	return false;
		
}

function SubmitRefundOrder(oid){
	
	var SecurityForm=$('#SecurityForm').val();
	
	bootbox.confirm({  
	   buttons: {  
		  confirm: {  
			 label: '确认',  
		  },  
		  cancel: {  
			 label: '取消',  
		  }  
	   },  
	   title:'退款操作',
	   message: '<div class="row"><div class="form-group"><label class="col-sm-2 control-label no-padding-right">退款金额 (元)</label><div class="col-sm-5"><input type="text" class="form-control" placeholder="请输入您的退款金额" id="RefundMoney" maxlength="5"></div></div></div>',  
		   callback: function(result) {  
			  if(result) {  
				 bootbox.hideAll();
				 var refund=$('#RefundMoney').val();
				 $.post('{echo U("/post/task/refund/id/".$id)}',{oid:oid,refund:refund,SecurityForm:SecurityForm}, function(json) {	
						$('.bootbox').PhpappProgress({json:json});
						return true;	
				 }, 'json');
				  bootbox.dialog({
						 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
						 title: '<i class="icon fa fa-retweet"></i> 提交中',
						 closeButton: false
				 }).PhpappProgress({time:5000});
			 
				  return false; 
	  
	  
			  }
		   } 

	})
   
	return false;
		
}
// 驳回重新上传
function SubmitRejectOrder(oid){
	
	var SecurityForm=$('#SecurityForm').val();
	var RejectContent=um.getContent();
	bootbox.confirm({  
	   buttons: {  
		  confirm: {  
			 label: '确认',  
		  },  
		  cancel: {  
			 label: '取消',  
		  }  
	   },  
	   title:'驳回操作',
	   message: '<div class="row"><div class="form-group"><label class="col-sm-6 control-label no-padding-right">驳回操作：驳回后服务商可重新上传</label></div></div>',  
		   callback: function(result) {  
			  if(result) {  
				 bootbox.hideAll();
				 $.post('{echo U("/post/task/reject/id/".$id)}',{oid:oid,SecurityForm:SecurityForm,RejectContent:RejectContent}, function(json) {	
						$('.bootbox').PhpappProgress({json:json});
						return true;	
				 }, 'json');
				  bootbox.dialog({
						 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
						 title: '<i class="icon fa fa-retweet"></i> 提交中',
						 closeButton: false
				 }).PhpappProgress({time:5000});
			 
				  return false; 
	  
	  
			  }
		   } 

	})
   
	return false;
		
}

</script>